<!--
 * @Author: lixb
 * @Date: 2020-08-19 10:29:30
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2020-09-17 15:33:09
 * @Descripttion: 福利概况模块
-->
<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span class="modul-title">
          <img
            src="@/assets/img/福利概况.png"
            style="height: 25px;width: 25px;margin-right: 10px;"
          />
          <span>福利概况</span>
        </span>
      </div>
      <div class="text item">
        <div class="text-explain">
          先消费后结算，每月核对账单后即可开票
        </div>
        <div class="balance-bg-img">
          <span>{{ info.effectiveAmount || 0 }}</span>
          <p>当前余额（元）</p>
        </div>
        <div class="foot-text">
          <div>
            <div>{{ info.totalAmount || 0 }}</div>
            <p>总申请额度（元）</p>
          </div>
          <div>
            <div>{{ info.orderMonthAmount || 0 }}</div>
            <p>本月消费（元）</p>
          </div>
        </div>
        <div style="clear: both;"></div>
      </div>
    </el-card>
  </div>
</template>

<script>
  import { findAdvanceDetail } from '@/api/home';
  export default {
    data() {
      return {
        info: {},
      };
    },
    activated() {
      this.getInfo();
    },
    methods: {
      getInfo() {
        findAdvanceDetail().then(res => {
          this.info = res.data || {};
        });
      },
    },
  };
</script>

<style lang="scss" scoped>
  .el-card.is-always-shadow {
    border-radius: 10px;
  }
  .modul-title * {
    font-weight: bold;
    font-size: 18px;
    display: inline-block;
    vertical-align: middle;
  }
  .box-card {
    margin-top: 10px;
    .text-explain {
      color: #999999;
      font-size: 12px;
      text-align: center;
      margin-top: 30px;
      margin-bottom: 50px;
    }
    .balance-bg-img {
      text-align: center;
      width: 195px;
      padding-top: 50px;
      margin: auto;
      background: url('~@/assets/img/当前余额背景.png') no-repeat;
      height: 195px;
      span {
        color: #697bff;
        font-size: 32px;
        font-weight: bold;
      }
      p {
        font-size: 17.6px;
      }
    }
    .foot-text {
      margin-top: 20px;
      margin-top: 70px;
      > div {
        float: left;
        width: 50%;
        text-align: center;
        div:first-child {
          font-size: 20px;
          color: #697bff;
          font-weight: bold;
        }
        p {
          font-size: 12px;
        }
      }
    }
  }
</style>
